/**
*   \file   Segment2.h
*   \author Dave Reid
*   \brief  Header file for the 3D segment class.
*/
#ifndef __EAGL_SEGMENT2_H_
#define __EAGL_SEGMENT2_H_

#include "../Shapes/Point2.h"

namespace eagl
{

/**
*   \brief  Class representing a 3D line segment.
*/
class Segment2
{
public:

    /**
    *   \brief  Default constructor.
    */
    Segment2() : m_start(0.0f, 0.0f), m_end(1.0f, 0.0f)
    {
    }

    /**
    *   \brief  Copy constructor.
    */
    Segment2(const Segment2 &line) : m_start(line.getStartPoint()), m_end(line.getEndPoint())
    {
    }

    /**
    *   \brief  Constructor.
    */
    Segment2(const Point2 &start, const Point2 &end) : m_start(start), m_end(end)
    {
    }


    /**
    *   \brief  Retrieves the start point of the segment.
    *   \return The start point of the segment.
    */
    const Point2 & getStartPoint() const
    {
        return this->m_start;
    }

    /**
    *   \brief  Retrieves the end point of the segment.
    *   \return The end point of the segment.
    */
    const Point2 & getEndPoint() const
    {
        return this->m_end;
    }

    /**
    *   \brief  Sets the start point of the segment.
    *   \param  start [in] The new start point of the segment.
    */
    void setStartPoint(const Point2 &start)
    {
        this->m_start = start;
    }

    /**
    *   \brief  Sets the end point of the segment.
    *   \param  end [in] The new end point of the segment.
    */
    void setEndPoint(const Point2 &end)
    {
        this->m_end = end;
    }

private:

    /// The start point.
    Point2 m_start;

    /// The end point.
    Point2 m_end;

};

}

#endif  // __EAGL_SEGMENT2_H_